package com.qrlib.decode.impl;

import android.graphics.Rect;
import com.qrlib.decode.DecodeCallback;

class ScanFrameRequest {

  public final byte[] data;
  public final int width;
  public final int height;
  public final boolean rotate;
  public final Rect crop;
  public final DecodeCallback callback;
  public String decodeResult;

  public ScanFrameRequest(byte[] data, int width, int height, boolean rotate, Rect crop,
      DecodeCallback
          callback) {
    this.data = data;
    this.width = width;
    this.height = height;
    this.rotate = rotate;
    this.callback = callback;
    if (crop == null) {
      this.crop = new Rect(0, 0, width, height);
    } else {
      this.crop = crop;
    }
  }

  @Override
  public String toString() {
    StringBuilder b = new StringBuilder();
    b.append("[");
    b.append("data.length:");
    b.append(data.length);
    b.append(", width:");
    b.append(width);
    b.append(", height:");
    b.append(height);
    b.append(", rotate:");
    b.append(rotate);
    b.append(", crop:");
    b.append(crop);
    b.append("]");
    return b.toString();
  }

}
